package com.example.mvvm.binding

import android.util.Log
import androidx.databinding.BindingAdapter
import androidx.recyclerview.widget.RecyclerView
import com.example.mvvm.ui.my.CityAdapter
import com.example.mvvm.ui.my.MyAdapter

object ViewAdapter {
    @BindingAdapter(value = ["adaptertest"], requireAll = false)
    @JvmStatic
    fun setContent(rv: RecyclerView, adapter: MyAdapter?) {
        adapter?.let {
            rv.adapter = it
        }
    }

    @BindingAdapter(value = ["cityAdapter"], requireAll = false)
    @JvmStatic
    fun setContent1(rv: RecyclerView, adapter: CityAdapter?) {
        Log.e("wodepp","ddddd")
        adapter?.let {
            Log.e("wodepp","hhhhh")
            rv.adapter = it
        }?:let {
            Log.e("wodepp","null了")
        }
    }
}